const user = require("../../database/user")

module.exports = async (req,res,next)=>{
  const {userId} = req.body;

  if(!userId){
    res.send({
      code:2,
      msg:"缺少必传参数：userId"
    })
    return;
  }

  try {
    await user.deleteOne({userId})
    res.send({
      code:1,
      msg:"删除成功"
    })
  } catch (error) {
    res.send({
      code:0,
      msg:"删除失败"
    })
  }
}